package co.edu.udistrital.analyzer.newversion;

import org.apache.lucene.util.Version;

public class AnalyzerFactory {

	public static final String SPANISH = "SPANISH";
	public static final String ENGLISH = "ENGLISH";

	private AnalyzerFactory() {
	}

	public static final Analyzer getAnalizer(Version luceneVersion,
			String language, boolean isLearning) {
		Analyzer analyzer = null;
		if (isLearning) {
			if (SPANISH.equals(language)) {
				analyzer = new AnalyzerLearningSpanish(luceneVersion);
			} else if (ENGLISH.equals(language)) {
				analyzer = new AnalyzerLearningSpanish(luceneVersion);
			}
		} else {
			analyzer = new AnalyzerClassification(luceneVersion);
		}
		return analyzer;
	}

}
